﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Product;

namespace Broker.Mgr.ViewModel
{
    /// <summary>
    /// 用来显示的费率行
    /// </summary>
    public class DisplayRateRow
    {
        //private IList<IRateRow> rows;

        private double?[] rates;


        public DisplayRateRow(IRateRow[] rows)
        {
            int len=rows.Count() *RateRow.MAX_COLUMN;

            rates = new double?[len];

            for (int i = 0; i < rows.Count(); i++)
            {
                rows[i].Rates.CopyTo(rates, i * RateRow.MAX_COLUMN);
            }

            Key1 = rows[0].Key1;
            Key2 = rows[0].Key2;
        }

        public string Key1 { get; set; }

        public string Key2 { get; set; }

        public double?[] Rates
        {
            get
            {
                return rates;
            }
        }
    }
}
